﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Command
{
    [LogExceptionFilterAttribute2(Target = "HomeController")] //[MyFilter1(Target = "HomeController")]//注意我在这里把MyFilter1注释了.[HandleError] 
    public class HomeController : BaseController
    {
        [LogExceptionFilterAttribute2(Target = "HomeController.Filter")]
        [LogExceptionFilterAttribute(Target = "HomeController.Filter")]
        public ActionResult Filter() { return Content("<div>这是在Action方法里面返回的内容！</div>"); }
        protectedoverridevoid OnActionExecuted(ActionExecutedContext filterContext) { filterContext.HttpContext.Response.Write("<div>这是在HomeController里面重写OnActionExecuted方法添加的内容！</div>"); }
        protectedoverridevoid OnActionExecuting(ActionExecutingContext filterContext) { filterContext.HttpContext.Response.Write("<div>这是在HomeController里面重写OnActionExecuting方法添加的内容！</div>"); }
        protectedoverridevoid OnAuthorization(AuthorizationContext filterContext) { filterContext.HttpContext.Response.Write("<div>这是在HomeController里面重写OnAuthorization方法添加的内容！</div>"); }
        protectedoverridevoid OnException(ExceptionContext filterContext) { filterContext.HttpContext.Response.Write("<div>这是在HomeController里面重写OnException方法添加的内容！</div>"); filterContext.ExceptionHandled = true; }
        protectedoverridevoid OnResultExecuted(ResultExecutedContext filterContext) { filterContext.HttpContext.Response.Write("<div>这是在HomeController里面重写OnResultExecuted方法添加的内容！</div>"); }
        protectedoverridevoid OnResultExecuting(ResultExecutingContext filterContext) { filterContext.HttpContext.Response.Write("<div>这是在HomeController里面重写OnResultExecuting方法添加的内容！</div>"); }
    }
}